#ifndef WEATHER_LABEL_H
#define WEATHER_LABEL_H

#include <QLabel>
#include <QPainter>
#include <QList>
#include "weatherinfo.h"

class weather_label : public QLabel
{
    Q_OBJECT
public:
    explicit weather_label(QWidget *parent = nullptr);
    
    void paintEvent(QPaintEvent *event) override;
    void setWeatherData(const QList<Forecast>& forecasts);
    
    void setHighCurveColor(const QColor &color);
    void setLowCurveColor(const QColor &color);
    void setCurveWidth(int width);
    void setPointSize(int size);

protected:
    void mouseDoubleClickEvent(QMouseEvent *event) override;
    
private:
    void calculatePoints();
    
    QColor m_highColor = QColor(255, 100, 0);
    QColor m_lowColor = QColor(0, 100, 255);
    int m_curveWidth = 2;
    int m_pointSize = 8;
    
    int m_highTemps[7] = {0};
    int m_lowTemps[7] = {0};
    QPointF m_highPoints[7];
    QPointF m_lowPoints[7];
};

#endif // WEATHER_LABEL_H
